Fix a bug that would cause in/or queries to return no results