Add doc. Fix/add tests.