Implement fixAliasReferences.