Fixed errors in rating calculations