Fix crashes related to sdb