Fix a cave generation crash