fixed off-by-one error in replication history stream creation