Fix initialization order problem in tests.