Fixed HTMLWriter and its query template.