Fix refs which should be ref.