Fix a memory error found with Valgrind...