Fixing bugs from updating datafile