Merge pull request #1969 from thisch/doctest_cleanup

Doctest cleanup
Fix issue 3728