Fix the bug in <, > operator for segmented iterator
merged the modified changes from the upstream