Fix issue with queries with more than one term