fix issue #180 and fixed a bug in demos

Fixed a bug in demos/index.js (the new click function instead of
doClick).
Fixed issue #180.