Fixed serialization bug in retry code