Updated the documentation.
Added more tests.