Fix factoring mpz_get_ui issue