Added events validation and fixed errors in the examples