Fixed an issue causing segfaults on some machines.