Bug: gmp_cmp returns values outside -1, 0 and 1