Fixed minor bug in events