valgrind fixes of memory-leaks