Fix a leak/crash issue.