Fixes #1472: set event sender if possible.