fix query issues

The bounding box that was assembled from the remote query was wrong.

Also fixed a reference exception when the bounded query didn't match anything. Before, it was querying the features and then bypassing the check that the offset was greater than the matched count