Better support for aliased expressions and sub queries