fixes and enable doctests