Improved error reporting

Instead of an error count, the error messages will be collection and reported on stderr when the app exits.

Sorry, for the whitespace changes.