Fix reference errors.