Fix leaked keys issue.