Changed comments to docstrings
Added fix for custom messages error throwing.
Added fix for custom messages error throwing.