Fix bug in Query.js