Fix the check that level change is legal