Fixed is_prime; the function wasn't correct from time to time.