fix off-by-one issue in the frame counter of torrent_history