Fixes to rating system

- fixed function names
- fixed unnecessary call to function
- changed table to use 1, -1
- changed SQL lines according to the table change