off-by-one issue in torrent_history