fix rest in batch calculation

nice in case it is bigger than 1, ie download_num:17 limit:3
Merge pull request #3 from zigotica/patch-2

fix rest in batch calculation