Fix use of Array.splice with IE8