Added escaping for filenames containing spaces