Fix bug during refactoring for deleting category.