Added a clear() function that makes sure the onSpanRemoved callback is always issued