Added HtmlElementInitializationTest and fixed some bugs