fix range and position methods on Query