Properly detect and link doctest errors.