Various improvements to the logging