added more documents and more explicit error messages.