INT_MAX used previosly is indeed max value for int, whereas on LP64 platforms, long is used for mp_int_t. Using MP_SMALL_INT_MAX is the correct way to do it anyway.