fix segfault when running all tests