Several fixes to tests.