Improve Filename Validation Robustness

This pull request adds checking for invalid filenames on Windows (#270)