Fix the integer overflow problem