Test Suite Fixes

 * missing assignment in `QueryContext#cast(Object,String)`
 * undeclared external variables with non-empty URI in test cases