More integration between data from file read and metadata, some validity checks added.