fix handling of empty tree
Merge pull request #114 from ndawe/master

[MRG] fix handling of empty trees