Fix up deletion of categories