Fix concurent modification in arrays