I think the memory leak + segfault is gone for now :D