various improvements

also submitted PR to gtorrent-core