Fixed bugs in the atlas and level manager.