better handling of paths when using run-script