Added tests for the events package and bugfixes