Fix some bugs for rating process