more memory leak fixes vian valgrind