minor fixes to download handler