Bugfixs and tidy up File::Temp;

Hi.  I found a few problems when passing an array of scalar references and I've tidied up a few things to do with File::Temp.  Also you were changing the global CWD which was a problem.

Hope you don't mind me fiddling with your code.

Cliff.