Bug fix with tmpdir and input files