Fix Issue #57, NPE in tree set