Change cout ref's to cerr on error messages.