bugfixes in leveling