Fix some issues with trace event reordering.