Fix stack overflow on page reload in IE
Merge pull request #861 from nite23/patch-12

Fix stack overflow on page reload in IE