Fix two issues in net/torrent.py