Fix misuse of JavaScript array.