Enable specifying output directory.
Remove an unnecessary test.
Test with tempdir.