Made facet handling somewhat more robust.