Added tests for some event dispatching edge cases.