Fix crashes in past commits