Fixed possible Valgrind error