Fix bug when deleting multiple categories.