TST: fixed all doctests.

Examples in function documentation can now be checked using nose using:
nosetests --with-doctest