Hopefully fixed segfault