Properly handle filenames with single quotes