Fix IE10-in-IE8-mode retemplating bug

Auditors: eater, cbhl