Fixed events, added logging