Fixed some bugs in dc-query