fix range ending with infinity