Fixes for tracing output with exit code != 0