Fixed logic error for number of cpus