fixes for doctest and pep8