Improved a docstring and an error message.