Trims array before saving it.