Fix bugs with event propagation.