Fix documentation and some tests.