Fixed a bug where the game crashed when generating a new world.