randarray tests, fixed iid bug and sum bug