Fix loop in corv_writ_sec