A whole bunch of debugging changes