Gas in simulations of high-redshift galaxies and minihaloes