Adjust log levels.
Do not change WRITE_BUFFER_SIZE.
Use uintptr_t for cookie manipulation.