Finish changes for event handling and tests