Miscellaneous improvements to logging.