some fixes to the db