Issue #106 fix possible overflow on 64-bit systems