Avoid some more possible crashes