Make accumulate return uint64_t

Force the type of accumulate function.