query history - small bugfixes