Fixed function untagify to remove close tag