Fix bug in state handling where we incorrectly identified a missing pdu. Update tests to catch this case.