fix bug in DictList.query (with added test)