Fixed errors in grade cache calcs