Added some extra error handling to Grader.