fix and slight clean up of file metadata import