Fix ref pointers.