Added some more explicit error codes, as well as examples in the doc