cmd: Output error messages to stderr instead of stdout where appropriate.