Fixing back-references as well