Fix failing doctests

Trying to fix failing doctests dues to "unexpected exception".