Fixed leaking memory.