Improved generation of temporary files