Fix filename bugs: file paths are limited to 255; poor stripping of illegal file chars