Thanks Valgrind. Maybe this will fix the random crashes both on my machine and on the auto tester.