Fix level generation bugs