Part one of the fix for ROOT-6694