Fixed a couple of small bugs in the torrent search code and did some general cleanup.