Fixed memory leaks in Close()