Fix script to work with real filenames