tmp file names and mac improvements