Logging/warning improvements plus various fixes