small fix for Array.prototype.splice