Fix some panics.