fix inadvertent infinite loop in tests (should tests move to a submodule?)