Replace INT_MAX with INT32_MAX to avoid compile err