Fixed some memory leaks
Fixed memory leak