Finished fixing memory leak.