Fixes test_direct_loop.py.