Added better 1.8-compatibility, but only by re-adding some `Dir.chdir` calls.