Reduceat regression fix

A fix for the reduceat regression issue gh-2892.