changed sample size to min( #torrents, SAVEPATH_SAMPLE_SIZE )