Fixed clean up of ConnectionTest::textExec()
Fixed Relation::getOriginalReferenceFor()