Fix potential segfaults if assert won't throw