fixes in ref_resolve