Fix fixing the declarations.
Add support for declaration references.