smaller fixes to db-generating