Adds subcategory feature, fixes some bugs