Fix major issues with order of punctuation when tags occur in the middle of strings. Also fix problems with not parsing the tail of elements in the middle of strings.