Added Event unit tests and fixed bugs