fixed range comparator to use RangeBoundary instead of raw content (prevents NPE)