Fix to isPrime()