Small patches and methods added to stabilize existing tests.