Fix facets again to work with the query optimizer