Fixed a bug in map generation