Use Object.prototype.toString instead of window.toString (for IE)