Fix bug with spaces in filenames