fix dispose issues in tests as well