Changes for valgrind