fixed minor bugs in download.py