Fix bug in html code generation