Update for deprecation of unsafe_ref