Filenames from schema with spaces

When I have a schema that has spaces in the name, and I try to download a generated file, It looks like the file name used ends up having spaces in it. i.e. A schema names My Schema will produce a file that is supposed to be called ‘My Schema.txt’. When clicking the link to download, I end up with a file named “My”.

Maybe replace the spaces with underscores or something so it downloads nicely?