Bugfixes for chat commands, item categories not shown, buying items

This are changes I did for Roger, he paid them and is contributing the changes to you, thanks to him.

* Fixes chat commands like /store not working
* Fixes item categories not being shown sometimes
* Fixes buying items not working sometimes
* Fixes compile error