Fixed use of deprecated tempnam