Memory leak fix
Fixed another memory leak.
Fixed more memory leaks.
Fixed last of valgrind leaks.