Fixed the case where a tag was inside a tag