Message logging fixes