Fixes memory leaks
Fixes buggy memory leak fix
Merge pull request #7 from lumoslabs/Number10Ox/mem_leak_fixes

Fixes memory leaks