Fixed primeFactors to work as intended.