Tried to fix illegal removes appearing by changing which index should correspond to yielding the offset when using remove events. It seems that the index used for yielding offsets to remove events should be opposite the index for yielding offsets to insert events. Anyway, the bug seems to be not reproducable now.