Added file exists conditional when polling filesize
Increased wait time when polling files
Renaming tmp file to something random-er
Using local vars in functions
Improved io redirection to log function
Changed validation order to eliminate checking on upload temp files
Improved scripts that find the next available file