Added -prof flag to bench script. Now using mktemp instead of tempfile for better compatibility.