Merged changes from gettorrent2.rb