Fix bug where after the 1018th torrent was downloaded the thing broke.