I think it's just an issue with the delete routine. When it puts everything back something gets out of step.

I'll review the code and see what's going wrong there.