User blog comment:SuperSpruce/Proposed fix to T array function to make it work past Gamma 0/@comment-36984051-20190623153224/@comment-35470197-20190626133043

Restricting a to be non-zero is insufficient, because Catastrophic Rule is still applicable to [0,0,1,0,1] in two distinct ways. You need to connect the result of the scanning process and the expression with (%,$,a,#).