Add some unit tests and fix Event constructor