Fix ordering of events

Fixes #14