Correct handling of filenames with spaces