Emit events. Fixes #4