Fix writing length in PacketMapChunk