Some logging fixes