do not clean PATH from double slashes if not needed, simplify code, update #1446