Fix remaining issues with unioning & interesecting ranges

The code that collected points where ranges start/end was correct (as of
earlier change), but there was one more place that needed to include the
same check (this is when we check whether a range contains a value - we
need to ingore wrong ranges).