Fix reference leak issue.