Clean up error message.
Expand logging and diagnostics.

Still TODO: log STDERR from subcommands.