Started fixing database stuff