Deleting tmp files (and added an option to keep them, defaulting to false).