Added fix for primeFactors()