More tests for #to_query