Array cannot be assigned to array offset fixes