some fixes in lgtree (not working currently)