Fix a few logging bugs