Merges ref_ptr implicit casting fixes.