Fix for arrays in toMap(). The API doesn't return the data with the correct hierarchy in queries.