Added event processing to Window, fixed errors in event dispatching