Added some event handlers.