Updates for subcategory

Solves issues #239 and #279.