Fix problems in tests