bugfix for valgrind.