Add tests for methods that modify query tree structure