Fixed crash when trying to strip long filenames