#2 Fixed query array handling