Changes to indexing to support VPOLL.

Other changes to fix time-range queries.