Fix subtree allocation that was causing invalid (out of bounds) reads and writes
Merge pull request #58 from wortiz/fix-bad-tree-allocation

Fix subtree allocation that was causing invalid (out of bounds) reads and writes