More work on the documentation, including some doctest fixes.