Don't crash on bad file metadata (fixes #43)