Fix integer overflow issues on 32-bit Linux.