Fix missing definition bug during transformations

DefaultReferenceTransformation assumed the existance of a definition
corresponding to each reference. It will not ignore references for which
this is not the case.