[fix] Applied fix to fix ROOT-6302 from ROOT master.
Revert "[fix] Applied fix to fix ROOT-6302 from ROOT master."

This reverts commit 5fb78cef51433461677231783d5d4554b8ce27e0.
[fix] Applied fix to fix ROOT-6302 from ROOT master.