It is expected behavior and a noobie mistake. When you enum the keys, the index is cast in stone. As you delete individual keys, you screw up the index.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.