fix Interval#toRange bug at upper end of range