Minor improvements to log and trace output.