fix tests and update db_structure