Added some docs and changed exception message.