Add insane levels of database debugging
Repair incorrect global entries at startup