T5246 and T7474 back working with -DDEBUG

thanks to SPJ'S fixes for #8553 in 985663ea47487a9e567814ba000e81d65358bf02