I think what's happening is that there's a loop somewhere in there that is counting up from 0 and deleting, which means it would do:

0: delete 0
1: since 0 is deleted, 1 went to 0, now you're deleting 2
2: same thing, so now you're deleting 4
.
.

What it's supposed to do is count down, so you don't have this problem. No worry, i'm throwing out most of that code anyway.

Mike