fix possible save order problem in tests and instrument