Bug fixes and more strict requirements for addEvent