Fix category deletion

* fixes #294
Merge pull request #295 from borisovg/master

Fix category deletion