Fixes for flat file