Bug fix: BN_is_prime() would fail with a high probability for small