Fix tests, and fix a show-stopper bug in the new MeasurementWrapper code.