Fix NPE on startup with flatfile