Bug fix: quote file path when using preprocessor for paths with spaces

Also remove unnecessary open when using preprocessor