Fixed an issue with calculating average grades of students