Fixed a bug when loading meshes from file.