Bundler/Pathname fix for 3-5-stable

I had the same problem as #180 on my 64 bits system.
Patch in #181 solved the problem.
This pull request is the same patch applied to 3-5-stable branch.