Today's testing

This fixes a range of bugs exposed on the CI rig. There are more to come, so no harm in waiting a day or two if required.