Segmentation fault when some tree are not present.

Fixes issue #43. Thanks @Adjuva, good catch.
Simplified containsData method.
Merge remote-tracking branch 'upstream/master'