Javascript fixes for IE8.