Fixes issue with deletions from the middle of arrays