Fix some deprecated warnings for to_owned()