Fix doctest intermittently failing due to nondeterminism of dict key
order