Some bug fixes to the log_ methods in the C port.