Event problems

Fix a few problems with events.