Fix multiprocessing to consider the number of cores on the system