Fixes bad references.