Bug in isPrime() fixed