Fix result of is_prime(p^2) for p a prime.

Previously is_prime(9), is_prime(16), is_prime(25) all returned true.