Fixing segfault (for purpose)