Cleanup is now also performed after cancelling download contracts. Additional refactoring of the StartDownload function