Fix for nodes with undefined parent
Merge branch 'xxinfinityxx-master'
Added test for #132