Use temporary files in test. Introduce more elaborate tests.