Fix off-by-one error of index in CloseThisPage