Fixes bug where grades were not sorting correctly