Correct generation of ghost hints for references
Merge pull request #1984 from catharanthus/fix_ref_hints

Correct generation of ghost hints for references