Fixing ref_ptr usage.