Most likely a bug in the script that writes beyond the end of a series. Check the lengths of all series that you're using, and the way how you access them.