Fix check for num_threads