Improvements for looking for closing tag.