multiple fixes to data creation code