Improved how publication events are removed when direct publishing is used.