make safeRange lt/lte/gt/gte aware