Fix file opening stuff.