Fix event dispatch on initial render.