Some small changes in documentation and error handling