Fix doctest handling