Fix broken doctests

This patch fixes the way doctests are loaded by test.py so all doctests are included.

Also included in this patch some minor doctest fixes.