Fixes to download script.