Resolved InvalidStateError bug in IE10+. Fixes #37.

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