download: fix bug that somehow doesn't show up on the default optimization level