Fixed two crashes.