fixed integer overflow in 32 bit machine.