Fix references bug.