Queries written as first term, second term fail to return all the data. From inspecting with a python debugger, it seems like the issue is in the part of the code that prunes excess columns: it searches for what effectively is the string " second term" in a list of column names that will contain "second term" without the initial space.