fixed bug in rand_source

data isnt empty until incrementing index by 4 would EXCEED the
size of the random data.

also added some debug statements