Bug #16: Fix delete categories with dependencies