Don't use $ in temp filenames

It breaks things on *nix

Credit for finding this goes to @kentaromiura. I just did a quick untested ghetto pull request using the GitHub UI.