Language changes: to_owned() on &str is being deprecated.

This commit should prevent tests from being failed in the future.