Fixed bugs with events not attached to components