Fixed potential testing issue

This fixes the tests not working with the `--repeat` flag.