Fix int32/int64 problems in tuning code.