Some tests and a few other bits and pieces.