Fix IE8 potentially throwing during restoreSelection