Segmentation fault when some tree are not present.

Fixes issue #43. Thanks @Adjuva, good catch.