Important fixes to data management