Fixes all external references in classes.