test/nonlocalState appears to be working outside of valgrind, but causes a segfault with valgrind for some reason?...