Fixed IE8 issues

Doesn't work in IE8, but at least now it wont throw errors.