Fixed expected seqnum getting set to 0 in the while loop