Basic fixes for range query processing.
Merge pull request #1046 from tweise/hds

Basic fixes for range query processing.