Added some tests and updated docstrings.