Bug fixes by addition of EventEmitter on es.js