Format tracebacks from unexpected errors properly