Bug fixes for grades