more cleanup for valgrind