Fix dumb bug in logic for checking primes