Use Object.prototype.toString instead of window.toString

Fixes an IE error `Invalid calling object` when calling `window.toString`.

> The Window's toString is implementation-specific and there is nothing in the specification saying methods on DOM Host Objects have to work with call/on other objects/etc

Source:
http://stackoverflow.com/a/19321984