Are you sure you need to use `static_cast<Integer>(a).as_mpz()` instead of the more simple `a.as_mpz()`? I think that should work just fine.

This applies to all the other usage below as well.