improved error messages, and documentation.