Fix critical bug in accumulate.