Improve error formatting, and always output errors to $stderr.