Fixed grade calculations.
Some more grade calculation adjustments