Generate filenames without spaces.
Made the code more pep8 compliant.