Looking at the code, I think it is wrong. The block of code at line 3339 should be
Code:
if series_changed or series_number_changed \
or kobo_series_id != series_id \
or kobo_series_number_float != newmi.series_index:
This might be the root cause of the problem.