1.0: updated to fix registration of custom events.