Don't pass handler function as data for events + test (#1140)