fix the integer overflow issue
fix the INT_MIN definition issue