Not sure why this fixes the segfault, but whatever.