Fix IE8 errors. Closes #45