Adds support for subqueries