Reverting mod function. This was not the colprit.
Using 'window' instead of 'this' to call the anonymous html5 shiv function. Function is wrapped by window.Modernizr where 'window' is properly defined.