Improvements to logging external commands.