fix bugs in doctest::aptest