Major fixes for event system