MTree memory leak fix