Fix for memory leak.