db
Fix many bugs