Use mktemp to create proper temp files