Fix legacy scan implementation for non-commutative reduction operations