Fix invalid counting of inverted intervals when added or substracted