Allow us to set random seed. Fix definition of of p.