Fixed a memory error detected with Valgrind...