context statementRef tests and fixes