Fixed Bug #14 ("Invalid read" reported by valgrind)