Fix bug in mapgen