Fixed generateMap bugs, fixed printMap bug