An event handler can be removed twice.

Fix a bug with Internet Explorer 8
Refactor gruntfile