Logging fixes