Cleanup database stuff a bit