Updated docs and added tests.