fix cases where the start of the range is 0