Fixed IE11 JS errors

Closes issue #1022.
Thanks to @mattlee78 for pointing this out.