IE8 bugs fixed

Fixed some bugs and problems with IE8