Fixed Nonetype in array.

Second iterative loop was outside of for loop.