Changed error message output to stderr from stdout.