Add .to_s for pathname usage for earlier versions of ruby.