fixed some bugs in Dom.query()