Fix a memleak that's been there since 5.1.0
more misc cleanup
Merge pull request #25 from linas/desub

fix memleak that got introduced in 5.1.0