Account for nested nodes
Add tests for nested nodes
Merge pull request #2 from timhudson/fix-nested-nodes

Fix nested nodes