Fixed some bugs relating to returning file names, extra output from external process call