Added valgrind checking to tests.