Fix query tool -> html output
* fix #939