Found a bug!

was:
line 91: if (num_arrays != 0):

is:
line 91: if(num_arrays > 0):

"What if the silly guy decides to put a negative number of arrays, that wouldn't be very nice!"