Trying to fix a segfault