Added truncation in tag parser to avoid illegal lengths.