Ensure that we have the correct toString reference

In IE "toString" is not available on the global (window) object. See http://stackoverflow.com/questions/1669079/window-tostring-call-is-undefined-in-ie8