fix no implicit conversion of Pathname into String in some cases