Fixing PDU length calculation