Resolved InvalidStateError bug in IE10+. Fixes #37.

This should also fix bugzilla bug [#1006775](https://bugzilla.mozilla.org/show_bug.cgi?id=1006775).