Bizarrely, I previously submitted a PR to fix this, it was (eventually) merged, and yet I don’t see the fix in the current version.
Ah, I see it was merged to ‘master’ and not to ‘main’. That sounds like a problem!
This was the fixed line
avail_cores=`lscpu --parse=core | egrep -v ^# | sort -u | wc -l`