Added logic to clean up temporary files when finished, if not running in debug mode.