Fixed a typo: "and" -> "an".
Removed "-interaction=batchmode" to LaTeX, since it was breaking on Jeremy's machine.
Use rm -f.
Only use open on OSX.