Fix example code
Print errors to stderr