Fixes the segfault occuring when the tests run