Fix getting number of cores.