Critical error fix; updated doctests