Fixed the `ArgumentError` issue when executing the routines with `cwd` set.