Fixed a bug in numPartsToTry calculation.