Fix dangling references.