Fixed database stuff