Fixed level switching bug.