Fixed bug in download batch algorithm