Add rand for nvec.