Patch from ROOT-5742