several bug fixes for IE8, simplified