Subcategory query can now use parent = 0 without breaking

Closes #4644