Fix crash with multi-level subcategories.