bug fix in random tensors