Revert default category if it is deleted

Fixes #312