Fixed a "double free" bug.