Test cleanup

This fixes a couple of tests which were failing due to problems with the tests themselves rather than anything else.