Add trailing backslashes and simplify paths