Fixed error in is_naive_prime()