Added check for ranges where both endpoints are the same