Switched from mktemp to mkstemp