Some tweaks to rating code