Better fix for local path (cross-platform)

Second try at fixing issue #1272, now with added Unix support.