fixed tests and doctests