IE8 fix, closes #163, closes #164