Ported internal fixes to log generator.  Oops for not bringing these over sooner.