Stop leaving files open everywhere