Added a check for valid hierarchical facet level so that e.g. sorting wouldn't break.