Fix bug with array handling