HTML Tidy, click handler improved and bug fixes