Actually fix up database stuff