Perhaps fixed the crash. More testing needed.