fix some reference errors