Added support for events on plain objects