Doctest fixes

I went through the "nosetests --with-doctest" failures and fixed them.