Fixed leakage in tests