Line 634 is: if plot not in ('', 0, plot_values[-1]): I think it should be: if plot not in ('', 0, int(plot_values[-1])):