Added valgrind call and fix