Fixed bug when an extra closing tag was found.