Fixed some small mistakes in count_atoms and fixed comments in ave_spatial