Fix a bug when using GMP.