Logging fix

Misc fixes for logging, and compatibility.