Fix grading logic.