Make sure that generated filenames don't have spaces so as not to break LaTeX