fix gmp and prime