Fix some doctest bugs