Fix log cleanup during tidy operations

Resolve bug 1078132