Fixed XYZ file generation