Better event handling
Merge branch 'master' into gh-pages