- fix wrong table-name in scope
- fix small bugs in categories assigning