HTML fix, updated some event functions