Fixing memory leak.