Fix #2816: Make doctest work