Fixed database errors.