Fix some computation in 32-bit that should have been 64-bit.
Completed the APIs required for logging.