Update TbHtml.php, fix some bugs and update TbHtmlTest.php