IE10 fixes

Makes the test suite run again.

Main problem was an accidentally shadowed variable that was only
used on IE.

Closes #1607