Fixed leveling bug