Updated documentation, improved test coverage.