Fix data parsing when data is an array