Fix transactions in tests