improve test coverage - and of course fix a few glitches uncovered by the tests