Fix bug in test that was causing tests to hang.