Merge pull request #351 from ndawe/master

remove redundant code in TemporaryFile and add test