fixed a bug in the handling of very long filenames (longer than 255