Removed "-interaction=batchmode" to pdflatex, as it was breaking stuff
on my machine.
rm doesn't work if the files don't exist!
open doesn't do what we want it to on linux.