Subexpressions don't work with context resolving

In the current implementation subexpressions do not work with context at all.

I've created several tests to illustrate the problem.