Small fixes

Various little fixes, mostly to make the test suite run more readily.