Fix data file creation/reading