Fix for foldSeq. Need to take into account varying chunk sizes.