Fix debug checks in DB #1235