fix for possibly invalid core calculation

otherwise this will (probably?) not run on systems with less than 3 cores