Add tests for complex queries:

We weren't testing complex queries and the documentation was inaccurate,
so both of those are fixed now.