Mapping to set the filename from the first line

And fix previous mappings;