Fix deprecation warning with assignment of value of new by ref.