Fix incorrect subtree condition

This bug causes some subcategories to disappear from listings.