Adds more complex cases to subquery tests.