Correct endianness of packet length