Fix query docs

This fixes some minor issues and adds more info to docs relating to queries.