Make tempfile creation more secure
Add curly brackets
More secure creation of tempfiles

Since all tempfiles are in our directory, only one "trap" command is
needed for cleanup.