Fixed double free bug.