Improved documentation and exception messages