Fix escaping of paths

cbugg: close bug-697