Fixed bugs related to subcategories