Add last_seq to the result from replicate