Fix data extraction from array