Fix rating calculating