Tweaks to get the unit tests nearly passing.