Attempt on fixing breakage caused by pull #4575 by using a simpler and more cautious coding