Fixed doctests and minor fixes.