Added error handling to binding and changed the way of inheriting EventEmitter.