Fix tree set contains bug