applied a couple of patch one from Oliver Stoeneberg and another one from * tree.c: applied a couple of patch one from Oliver Stoeneberg and another one from Rob Richards fixing #148448 Daniel