fix range query in tests