Also check for skipped sequence numbers and refactor error flag names.