Fix tree bugs of disabled items and other enhanced related to memory leak.