Fixed a bug in map saving