Fix for/fold typechecking on null accumulator

Closes PR 13259