Fix a rare crash upon generating moon dungeon