don't continue after a download error
fix a variable shadowing bug
Merge branch 'master' into osx