corrected bug and added unit test for transforming a term to a reference in a conversion context