Fixed valgrind error messages.