This looks like a massive hairball of code, from here to the end of the function. Would the following work instead?
```c++
if (l < split && h > split) {
    modifier += change;
    modify(-change, lo, l);
    modify(-change, h, hi);
} else if (h <= split) {
    if (lh == NULL)
        lh = new maxtree(lo, split);
    lh->modify(change, l, h);
} else {
    if (rh == NULL)
        rh = new maxtree(split, hi);
    rh->modify(change, l, h);
}
```
(I haven't tested it).