Fix packet type detection