Fix a couple crashes.