tools/ismindex: Keep count fields consistent with arrays in case of errors