Unable to fix errors in creation of db from iter.