Modified to fix problems with operating on a fast computer/SSD

Seems to be 'timing' type problems. Pipe connects right away, app doesn't die before trying to copy the file over. These are changes to fix those problems.