DOC: Improved documentation and error messages