Fix downloadTorrent function