Show error messages on stderr.
Fixed minor bugs.