Trying to find and fix a segfault