Doublefree

Clearer fix for old double-free bug.