Fixing database stuff