Fixes ambiguity handling in NameResolution