Fixed double free issue.