zawran, check the length of your array before and after. Something is going wrong somewhere.
I think it's the use of sizeof. Use len(array) instead.
Also best to use...
For Local d:Int = EachIn a
Print d
Next
rather than a count field especially after using slices.