Fixed some game-crashing bugs in Level class