fixed several issues with leveling