COMP: partially fix #9, and a leak
Merge pull request #10 from ihnorton/issue9_partial_fix

COMP: partially fix #9, and a leak