Fixed a memory leak.