fixed doctests and quickcheck test suite