various fixes to logging system