Bug fix for memory leak problem.