Fixes/uncaught typeerror fix

Fixes a problem that breaks all javascripts in the pages when the exception is thrown. 
The error is: Uncaught TypeError: Cannot read property 'msie' of undefined
This is not a definitive fix, but a "patch". Taken from: http://stackoverflow.com/a/16972927/423816