Fixed logic bug in calculated ratings