Fix nested array bug