Fixed illegal invocation exception under node-webkit.

Pull request resolve issue #8