threads: correctly initialize number of threads.