Build fixes for when ref_ptr<> automatic type conversion is turned off