<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def sanitize(self):
        '''
        Check and optionally fix properties
        '''
        # Let the parent do its stuff
        super(Protocol, self).sanitize()

        # Check if the next header is of the right type, and fix this header
        # if we know better (i.e. the payload is a ProtocolElement so we know
        # the header_type)
        if isinstance(self.payload, Protocol):
            self.next_header = self.payload.header_type