Fix removeTree bugs.