Fixed a couple unclosed file warnings in tests