Fixing some bugs in the download manager.