Fix bug where Pathname raised TypeError

(#<TypeError: no implicit conversion of Pathname into String>)