Fix issue with queries with no matches.