Use correct extension in tempfile