More error handling rework and updated example