Tweaked for IE9 and 10.