Fix ref pass 2