Removed extra parameters from query() and added _query_from_range_index().