Fixed issues with event dispatch test