Fix createArrays bug

Made a mistake when I was refactoring.