Clean-ups and doctest update.