a whole bunch of nits and small fixes