Restored compatibility with IE8
Fixed bugs on IE8