bugs and typos

A couple of adjustments when sampling for z and found some typos in the
manuscript.