Fix bug with FireFox 5

* addEventListener/removeEventListener
[22:14:10.475] uncaught exception: [Exception... "Not enough arguments"  nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)"  location: "JS frame :: ..... :: whenDocumentReady :: line 2219"  data: no]

* CustomEvent
[22:32:20.137] [Exception... "Operation is not supported"  code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)"  location: "Web Console Line: 1"]