Fix issues with spaces in filenames or directories.

White spaces in file names or directory names caused syntax check to fail without a useful error. This change ensures white spaces are handled correctly.