Use CAST_ZINT_TO_INT in some places, so we can easily spot casts