Flatfile repair