More tests for events and some fixes