Fixing memory leak reported in the review.