Fix array handling