Use number of cores to set up default threads
Fix pool size variable mess