added fix for firstNPrimes()