folding in the cwd inaccessible fix from xgoat, along
with making it ruby 1.8.7 compliant