fix up some reference errors