Updated event handling a bit.