Handle files without meta data correctly.

Here file.flags is NoneType which you cannot access.
Merge pull request #17 from hubx/metadata

Handle files without meta data correctly.