fix miller-rabin