Bug fixes for number_of_cpus and cleanup of code.
Rename number of cpus to get_ncpus.