Remove unneeded include
Add error handlers and some program options
Add a patch for stderr