Fix output path if argument contains / or \ (off by 1)