Small fixes

added some double-quotes, just in case
take only the basename of the script, so no path info is added when
constructing temp filename